package org.balthie.cal.impl.io;

import org.balthie.cal.core.IOutputer;
import org.balthie.cal.core.IVirtual;

public class ConsoleOutputer implements IOutputer, IVirtual {

	@Override
	public void println(Object... args) {
		this.print(args);
		System.out.println();
	}

	@Override
	public void print(Object... args) {
		if (args != null && args.length > 0) {
			for (Object o : args) {
				System.out.print(o.toString());
			}
		}
	}

	@Override
	public void printlnErr(Exception e, Object... args) {
		System.err.print("ERROR: 非法输入 ");
		System.err.print(e.getMessage());
		System.err.println();
		if (args != null && args.length > 0) {
			for (Object o : args) {
				System.err.print(o.equals("") ? "回车" : o.toString());
			}
		}
		System.err.println();
	}
}
